import Vue from "vue";
import VueRouter from "vue-router";

import Login from "../views/Login.vue";
import Register from "../views/register/Register";

import Resume from "../views/resume/Resume";
import ResumeEducation from "../views/resume/ResumeEducation";
import ResumeMessage from "../views/resume/ResumeMessage";
import Mynews from "../views/resume/Mynews";
import Recruitment from "../views/resume/Recruitment";
import ResumeUpdata from "../views/resume/ResumeUpdata.vue";
import EducationUpdata from "../views/resume/EducationUpdata.vue"

import Companyuser from "../views/companyuser/Companyuser";
import Application from "../views/companyuser/Application";
import CompanyuserMessage from "../views/companyuser/CompanyuserMessage";
import PublishRecruitment from "../views/companyuser/PublishRecruitment";
import RecallRecruitment from "../views/companyuser/RecallRecruitment";
import UpdateRecruitment from "../views/companyuser/UpdateRecruitment";
import AddCompany from "../views/companyuser/AddCompany";
import CompanyList from "../views/companyuser/CompanyList";
import UpdateCompanyuser from "../views/companyuser/UpdateCompanyuser";
import UpdateCompany from "../views/companyuser/UpdateCompany";
import UpdateApplication from "../views/companyuser/UpdateApplication"


import Admin from "../views/admin/Admin";
import Adminrecruitment from "../views/admin/Adminrecruitment";
import Adminmynews from "../views/admin/Adminmynews";
import Adminmesage from "../views/admin/Adminmesage";

Vue.use(VueRouter);

const routes = [{
        path: "/", //改login为默认页面
        name: "登录",
        component: Login,
    },
    {
        path: "/register",
        name: "注册",
        component: Register,
    },
    {
        path: "/resume",
        name: "求职人员页面",
        component: Resume,
        redirect: "/recruitment", //默认页面加载
        children: [{
                path: "/recruitment",
                name: "职位信息",
                component: Recruitment,
            },

            {
                path: "/mynews",
                name: "我的消息",
                component: Mynews,
            },
            {
                path: "/resumeEducation",
                name: "学历信息",
                component: ResumeEducation,
            },
            {
                path: "/resumeMessage",
                name: "简历信息",
                component: ResumeMessage,
            },
            {
                path: "/resumeUpdata",
                name: "简历修改",
                component: ResumeUpdata,
            },
            {
                path: "/educationUpdata",
                name: "学历修改",
                component: EducationUpdata,
            },
        ],
    },
    {
        path: "/companyuser",
        name: "招聘者页面",
        component: Companyuser,
        redirect: "/publishRecruitment",
        children: [{
                path: "/publishRecruitment",
                name: "发布招聘信息",
                component: PublishRecruitment,
            },

            {
                path: "/recallRecruitment",
                name: "已发布的招聘信息",
                component: RecallRecruitment,
            },
            {
                path: "/companyuserMessage",
                name: "个人信息",
                component: CompanyuserMessage,
            },
            {
                path: "/updateCompanyuser",
                name: "修改招聘人员信息",
                component: UpdateCompanyuser,
            },
            {
                path: "/application",
                name: "应聘申请消息",
                component: Application,
            },
            {
                path: "/updateRecruitment",
                name: "更新招聘消息",
                component: UpdateRecruitment,
            },
            {
                path: "/updateApplication",
                name: "更新申请",
                component: UpdateApplication,
            },
            {
                path: "/addCompany",
                name: "添加公司信息",
                component: AddCompany,
            },
            {
                path: "/CompanyList",
                name: "查看公司信息",
                component: CompanyList,
            },
            {
                path: "/updateCompany",
                name: "更新公司信息",
                component: UpdateCompany,
            },
        ],
    },
    {
        path: "/admin",
        name: "管理员页面",
        component: Admin,
        redirect: "/adminrecruitment", //默认页面加载
        children: [{
                path: "/adminrecruitment",
                name: "招聘员信息管理",
                component: Adminrecruitment,
            },

            {
                path: "/adminmynews",
                name: "个人基本信息",
                component: Adminmynews,
            },
            {
                path: "/adminmesage",
                name: "修改信息",
                component: Adminmesage,
            }
        ],
    }
];

const router = new VueRouter({
    mode: "history",
    base: process.env.BASE_URL,
    routes,
});

export default router;